//Addition Chains
#include <iostream>
using namespace std;
const int N = 1e4 + 10;
int path[N];
int n;
bool dfs(int pos,int depth)
{
	if(pos > depth)
	{
		return path[pos-1] == n;
	}
	for(int i=0;i<pos;i++)
	{
		for(int j=i;j<pos;j++)
		{
			int x = path[i] + path[j];
			if(x > n)
			{
				break;
			}
			if(x <= path[pos - 1])
			{
				continue;
			}
			if(x + depth - pos > n)
			{
				break;
			}
			if(x * (1 << (depth - pos)) < n)
			{
				continue;
			}
			path[pos] = x;
			if(dfs(pos + 1,depth))
			{
				return true;
			}
		}
	}
    return false;
}
int main()
{
	while(cin>>n,n)
	{
		path[0] = 1;
		for(int depth = 0;;depth++)
		{
			if(dfs(1,depth))
			{
				cout<<"1";
				for(int i=1;i<=depth;i++)
				{
					cout<<" "<<path[i];
				}
				cout<<endl;
				break;
			}
		}
	}
	return 0;
 } 
